/*
	Remove Hash
	===========
	Removes the hash (and any characters following it) from a string. Especially useful for making Ajax calls with jQuery (1.4 and older)
	since IE (6,7,8) will return an error if the URL has a hash.
	
	Example:
	
	var url = '/person/ianhart#biography';
	alert(url.removeHash()); // Alerts '/person/ianhart'
*/
String.prototype.removeHash = function()
{
	return this.replace(/#(.*)$/, '');
}


/*
	Remove Leading Hash
	===================
	Returns the string with the first hash removed if it's the first character. Otherwise, it simply returns the string.
	Useful for making Ajax requests.
	
	Example:
	
	var href = '#/category/chairs';
	alert(href.removeLeadingHash()); // Alerts '/category/chairs'
*/
String.prototype.removeLeadingHash = function()
{
	return this.replace(/^#/, '');
}


/*
	Remove Domain
	=============
	Returns the string with the full domain removed if there's one at the beginning. Very useful if you're using the HREF attribute 
	since IE returns an absolute path.
	
	Example:
	
	var href = 'http://www.example.com/blog/post';
	alert(href.removeDomain()); // Alerts '/blog/post'
*/
String.prototype.removeDomain = function()
{
	return this.replace(/^https?:\/\/([^/]+)?/i, '');
}